import 'dart:convert';

import 'package:star_author/generated/json/base/json_field.dart';
import 'package:star_author/generated/json/shop_title_entity.g.dart';

@JsonSerializable()
class ShopTitleEntity {
  List<ShopTitleData>? data;

  ShopTitleEntity();

  factory ShopTitleEntity.fromJson(Map<String, dynamic> json) =>
      $ShopTitleEntityFromJson(json);

  Map<String, dynamic> toJson() => $ShopTitleEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopTitleData {
  int? id;
  String? name;
  int? position;
  @JSONField(name: "backflow_tips")
  String? backflowTips;
  @JSONField(name: "created_at")
  String? createdAt;
  @JSONField(name: "updated_at")
  String? updatedAt;
  String? image;
  @JSONField(name: "real_image")
  String? realImage;
  String? prefix;
  List<ShopTitleChildrenEntity>? children;

  ShopTitleData();

  factory ShopTitleData.fromJson(Map<String, dynamic> json) =>
      $ShopTitleDataFromJson(json);

  Map<String, dynamic> toJson() => $ShopTitleDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopChlildrenEntity {
  List<ShopTitleChildrenEntity>? data;

  ShopChlildrenEntity();

  factory ShopChlildrenEntity.fromJson(Map<String, dynamic> json) =>
      $ShopChlildrenEntityFromJson(json);

  Map<String, dynamic> toJson() => $ShopChlildrenEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ShopTitleChildrenEntity {
  int? id;
  String? name;
  bool? isSelect;
  List? priceRange;

  ShopTitleChildrenEntity();

  factory ShopTitleChildrenEntity.fromJson(Map<String, dynamic> json) =>
      $ShopTitleChildrenEntityFromJson(json);

  Map<String, dynamic> toJson() => $ShopTitleChildrenEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
